﻿///<reference path="../../jquery-1.4.4.min.js" />
///<reference path="kooboo.validators.js" />

kooboo.validators.addMethod("length", function (value, params) {
    if (typeof params.min != "undefined") {
        if (typeof value == "undefined" || params.min > value.length) {
            return false;
        }
    }

    if (typeof params.max != "undefined") {
        if (value.length > params.max) {
            return false;
        }
    }

    return true;
});